﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PSE.ProcessManager.Common.Process
{
    /// <summary>
    /// Representa o estado do Processo.
    /// </summary>
    [DataContract]
    public class ProcessStatus
    {
        public ProcessStatus()
        {
        }

        public ProcessStatus(int progress, string step)
            : this()
        {
            this.Progress = progress;
            this.Step = step;
        }

        public ProcessStatus(ProcessStatus status)
            : this(status.Progress, status.Step)
        {
            this.IsRunning = status.IsRunning;
            this.StartedAt = status.StartedAt;
            this.FinalizedAt = status.FinalizedAt;
        }

        /// <summary>
        /// Indica o progresso do processsamento.
        /// </summary>
        [DataMember]
        public int Progress { get; set; }

        /// <summary>
        /// Indica se o processo esta em execução.
        /// </summary>
        [DataMember]
        public bool IsRunning { get; set; }

        /// <summary>
        /// Etapa sobre o estado atual do processo.
        /// </summary>
        [DataMember]
        public string Step { get; set; }

        /// <summary>
        /// Data/Hora do Inicio do Processamento.
        /// </summary>
        [DataMember]
        public DateTime StartedAt { get; set; }

        /// <summary>
        /// Data/Hora da Finalização do Processamento.
        /// </summary>
        [DataMember]
        public DateTime FinalizedAt { get; set; }

    }
}
